1. Field of the Invention
The present invention relates to computer memory architectures. More particularly, this invention relates to protecting compressed memories from being filled by automatically and temporarily reducing the precision of numbers such that the numbers can compress more efficiently.
2. Description of the Related Art
Computer memory systems have at least two major problems: there is seldom enough and what memory there is tends to be expensive. Unfortunately, high performance computing, e.g. computer gaming, demands large amounts of fast memory. Indeed, memory is often the most expensive component of many computers.
One way of reducing the cost of memory is to use data compression techniques. When data is compressed, more information can be stored in a given memory space, which makes the memory appear larger. For example, if 1 KB of memory can store 2 KB of uncompressed data, the memory appears to be twice as large as it really is.
One compressed data memory system is taught in U.S. Pat. No. 5,812,817, issued to Hovis et al. on Sep. 22, 1998, and entitled, “Compression Architecture for System Memory Application.” That patent teaches memory architectures that store both uncompressed and compressed data. Having both types of data is useful since, in practice, most data accesses are to a relatively small amount of the total data. By storing often accessed data in the uncompressed state, and by storing less frequently accessed data in the compressed state, the teachings of U.S. Pat. No. 5,812,817 can significantly reduce latency problems associated with compressed data.
Computer hardware designers can use the teachings of U.S. Pat. No. 5,812,817 to increase the apparent size of memory. By incorporating a memory of a known size, and by incorporating a compression technique having an assumed minimum compression ratio, a hardware designer can inform others how much apparent memory they can assume is available.
When implementing memory compression on numeric data structures used in real-time applications, e.g., 3D graphics, nondeterministic effects can cause certain data elements to compress poorly. Poor compression can cause the achieved compression ratio to fall below the assumed apparent memory, which, in turn, can cause the logical storage space to fall below that required by application software. If the problem becomes bad enough deallocation of real-time data that is required by the application software may be necessary.
A prior art approach that addresses the problem of poor compression is to use an extremely conservative minimum compression ratio assumption. While effective in preventing deallocation of real-time data, that approach artificially reduces the size of the memory that software designers can use.
Since hardware designers recognize problems associated with filled memory, they can provide a hardware flag that signals operating software that memory might be filling up. The technique of using hardware to signal software is termed trapping to software. Trapping because of filling memory provides software an opportunity to protect data or to take other protective action before a full condition occurs. In some applications, the software can simply store data in alternative memory devices, such as on an optical disk, or the software can dump unneeded data, such as a previous display screen, to free up more memory. However, in real-time applications such as computer gaming these approaches can be unacceptable. Storing to an optical disk dramatically increases latency issues, while dumping a previous display is not a viable option since the display will very likely be required again. Either approach causes serious display problems, and computer gamers do not like display problems.
Therefore, a technique, apparatus, and method of avoiding full compressed memory would be useful. In particular, a technique, apparatus, and method of avoiding full memory in compressed systems and that avoids or mitigates latency issues would be highly useful.